Conversation
This commit adds Google Cloud Platform as a deployment target for the Shareabouts API. Infrastructure: - Added OpenTofu configuration for GCP in `infra/gcp/`. Can add other platform tofu configs in infra/ later. - Configured Cloud Run for the API service. - Set up Cloud SQL (PostgreSQL) and Cloud Memorystore (Redis). - Created GCS bucket for media attachments. Application: - Updated `settings.py` for GCP-compatible storage, database, and cache. - Reverted static file serving to use local container serving (via `dj_static`) to preserve custom middleware functionality. - Updated `Containerfile` with collection of static files. - Integrated `google-cloud-logging` for GCP Error Reporting. Documentation: - Added comprehensive GCP deployment instructions in `doc/DEPLOY.md`.
…ose services, and add a test error endpoint.
…oyments and simplify Docker Compose configuration.
…mand from Containerfile for web service
…ting, update deployment documentation, and refine Celery broker URL parsing.
…make it a prerequisite for tests.
….x and match the local development environment.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR sets up Infrastructure as Code (IAC) for deploying the Shareabouts API to Google Cloud Platform using OpenTofu/Terraform. It also migrates CI/CD from Travis CI to GitHub Actions and adds a Makefile for common deployment tasks.
Changes:
- Added comprehensive Terraform/OpenTofu infrastructure configuration for GCP (Cloud Run, Cloud SQL, Redis, GCS, networking, IAM, secrets)
- Migrated from Travis CI to GitHub Actions for testing
- Added Makefile with targets for building, testing, and deploying to GCP
- Updated Containerfile to use virtual environment and support Cloud Run deployment
- Enhanced settings.py with GCP-specific configuration (GCS storage, database from components)
- Updated compose.yml to support test service and better environment configuration
Reviewed changes
Copilot reviewed 21 out of 24 changed files in this pull request and generated 16 comments.
Show a summary per file
| File | Description |
|---|---|
| infra/gcp/*.tf | Terraform/OpenTofu infrastructure definitions for GCP resources including Cloud Run, Cloud SQL, Redis, networking, storage, IAM, and secrets management |
| .github/workflows/test.yml | New GitHub Actions workflow replacing Travis CI for automated testing |
| Makefile | Build and deployment automation for local development and GCP deployment |
| Containerfile | Enhanced container definition with virtual environment and Cloud Run compatibility |
| src/project/settings.py | Added GCS storage backend and database configuration from environment components |
| src/project/urls.py | Added test error endpoint for debugging |
| compose.yml | Updated with test service and improved environment variable configuration |
| doc/DEPLOY.md | Added comprehensive GCP deployment documentation |
| requirements.txt | Added google-cloud-storage dependency |
| gunicorn.conf.py | Added logging and timeout configuration |
Files not reviewed (1)
- infra/gcp/.terraform.lock.hcl: Language not supported
Comments suppressed due to low confidence (1)
src/project/settings.py:100
- This assignment to 'ATTACHMENT_STORAGE' is unnecessary as it is redefined before this value is used.
ATTACHMENT_STORAGE = 'django.core.files.storage.FileSystemStorage'
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…REFIX` configuration via environment variables for Cloud Run deployment.
…OSTS` environment variable to automatically include Cloud Run and custom domain URLs.
…v2 domain management, load balancing, and SSL certificates.
…ne to Certificate Manager.
…n and service configurations These secrets archive the tfvars setup needed to work with the infrastructure.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.